*Going Green or Making Green: The Effects of Partisanship and Inflation on Environmental Executive Orders, 1945 - 2020*

*Erin B. Fitz, Colorado State University, 2022

* This Stata file corresponds with the final manuscript accepted for publication in Presidential Studies Quarterly, published 17 February 2023

* https://doi.org/10.1111/psq.12818

*To begin this analysis, first download the corresponding Stata data file: Going Green.dta 

*Distribution of DV
tabstat cap, stats(mean v n)
tabstat env, stats(mean v n)

*Correlations
pwcorr cap env majority lppc divided party natural tech change inflation unemployment approval foreign q1 q2 q3 ty1 ty2 ty3

*VIF Tests
regress cap majority divided party natural tech change inflation unemployment approval foreign q1 q2 q3 ty1 ty2 ty3
vif

regress cap lppc divided party natural tech change inflation unemployment approval foreign q1 q2 q3 ty1 ty2 ty3
vif

regress env majority divided party natural tech change inflation unemployment approval foreign q1 q2 q3 ty1 ty2 ty3
vif

regress env lppc divided party natural tech change inflation unemployment approval foreign q1 q2 q3 ty1 ty2 ty3
vif

**Table 1: Summary Statistics
summarize cap env majority lppc divided party natural tech change inflation unemployment approval foreign 

**Table 2
nbreg cap majority divided party q1-ty3, cluster(congress)
nbreg cap lppc divided party q1-ty3, cluster(congress)
nbreg cap majority divided party natural tech change inflation unemployment q1-ty3, cluster(congress)
nbreg cap lppc divided party natural tech change inflation unemployment q1-ty3, cluster(congress)
nbreg cap majority divided party natural tech change inflation unemployment approval foreign q1-ty3, cluster(congress)
nbreg cap lppc divided party natural tech change inflation unemployment approval foreign q1-ty3, cluster(congress)

**Table 3
nbreg env majority divided party q1-ty3, cluster(congress)
nbreg env lppc divided party q1-ty3, cluster(congress)
nbreg env majority divided party natural tech change inflation unemployment q1-ty3, cluster(congress)
nbreg env lppc divided party natural tech change inflation unemployment q1-ty3, cluster(congress)
nbreg env majority divided party natural tech change inflation unemployment approval foreign q1-ty3, cluster(congress)
nbreg env lppc divided party natural tech change inflation unemployment approval foreign q1-ty3, cluster(congress)

**Table 4
nbreg cap c.inflation##ib(last).party unemployment natural tech lppc divided change approval foreign q1-ty3, cluster(congress)

nbreg env i.tech##ib(last).party inflation unemployment natural lppc divided change approval foreign q1-ty3, cluster(congress)

nbreg env i.change##ib(last).party inflation unemployment natural tech lppc divided approval foreign q1-ty3, cluster(congress)

**Margins
nbreg cap inflation unemployment natural tech lppc divided party change approval foreign q1-ty3, cluster(congress)

**Figure 1
margins, at(inflation=(-2.73(2.16)18.87))
marginsplot, recast(line) recastci(rarea) graphregion(fcolor(white)) x(inflation) xlabel(-2.73 0 2 4 6 8 10 12 14 16 18.87) 

graph save inflation.gph

*To replicate Figure 1, complete the following in the Graph Editor:
	*Select the graph title ("Predictive margins with 95% CI") and delete
	*Select the x-axis title; change to "Rate of Inflation" and change text size to small
	*Select the y-axis title; change to "Predicted Number of EEOs" and change text size to small
	*Select the y-axis; go to "Grid lines" and unselect "Show grid"
	*Select the y-axis; go to "Reference line" and add 1.9 for the y-axis value
	*Select the reference line and change pattern to v. short dash; change color to black 
	*Under Graph and plotregion1, select plot 1 and change the opacity to 60%

**Figure 2
margins, at(party=(0 1))
marginsplot, recast(line) recastci(rarea) graphregion(fcolor(white)) x(party) xlabel(0 1)
graph save party.gph 

*To replicate Figure 2, complete the following in the Graph Editor:
	*Select the graph title ("Predictive margins with 95% CI") and delete
	*Select the x-axis title; change to "Party of the President" and change text size to small
	*Select the y-axis title; change to "Predicted Number of EEOs" and change text size to small
	*Select the y-axis; go to "Grid lines" and unselect "Show grid"
	*Select the y-axis; go to "Reference line" and add 1.9 for the y-axis value
	*Select the reference line and change pattern to v. short dash; change color to black 
	*Under Graph and plotregion1, select plot 1 and change the opacity to 60%

**Margins
nbreg env inflation unemployment natural i.tech##ib(last).party lppc divided change approval foreign q1-ty3, cluster(congress)

margins i.tech##i.party, pwcompare

**Figure 3 
margins, at(change=(0 1))
marginsplot, recast(line) recastci(rarea) graphregion(fcolor(white)) x(change) xlabel(0 1)
graph save changeparty.gph 

*To replicate Figure 3, complete the following in the Graph Editor:
	*Select the graph title ("Predictive margins with 95% CI") and delete
	*Select the x-axis title; change to "Party of the President" and change text size to small
	*Select the y-axis title; change to "Predicted Number of EEOs" and change text size to small
	*Select the y-axis; go to "Grid lines" and unselect "Show grid"
	*Select the y-axis; go to "Reference line" and add 1.9 for the y-axis value
	*Select the reference line and change pattern to v. short dash; change color to black 
	*Under Graph and plotregion1, select plot 1 and change the opacity to 60%
	
**Figure 4
margins, at(tech=(0 1) party=(0 1))
marginsplot, x(tech) recast(line) recastci(rarea) graphregion(fcolor(white))
graph save techparty.gph

*To replicate Figure 4, complete the following in the Graph Editor:
	*Select the graph title ("Predictive margins with 95% CI") and delete
	*Select the x-axis title; change to "Technological Disaster" and change text size to small
	*Select the y-axis title; change to "Predicted Number of EEOs" and change text size to small
	*Select xaxis1 and "Edit or add individual ticks and labels"; select to edit label for 0 as "No" and 1 as "Yes"
	*Select the y-axis; go to "Grid lines" and unselect "Show grid"
	*Select the y-axis; go to "Reference line" and add .3 for the y-axis value
	*Select the reference line and change pattern to v. short dash; change color to black 
	*Under Graph and plotregion1, select plot 1 and change the opacity to 60%; repeat for plot 2
	*Under Legend and key region, select key [2] and change Pattern to Long-dash
	*Under Legend and key region, select label [1] and change to "Democrat President" and change text size to small
	*Under Legend and key region, select label [2] and change to "Republican President" and change text size to small

********************************************************************************
